package dryven.unittest.validation.mockup;

import dryven.model.validation.ValidationReporter;

public class ValidatorReporterMockup implements ValidationReporter {

	private Object convertedValue;
	private boolean hasError = false;
	private boolean hasValue = false;
	@Override
	public Object getConvertedValue() {
		return convertedValue;
	}

	@Override
	public void reportError(String fieldName, String messageKey,
			Object... params) {
		hasError = true;
	}

	@Override
	public void reportLiteralError(String fieldName, String errorMessage) {
		hasError = true;
	}

	@Override
	public void valueConverted(Object newValue) {
		convertedValue = newValue;
		hasValue = true;
	}
	
	public boolean hasError() {
		return hasError;
	}
	
	public boolean hasValue() {
		return hasValue;
	}
}